package com.prs.crm.dao.purchase.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.purchase.PurchaseStoreInDao;
import com.prs.crm.domain.purchase.PurchaseOrder;
import com.prs.crm.domain.purchase.PurchaseStoreIn;

public class PurchaseStoreInDaoImpl extends BaseDaoImpl<PurchaseStoreIn>
		implements PurchaseStoreInDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<PurchaseStoreIn> getPurchaseStoreInByOrder(
			PurchaseOrder purchaseOrder) {
		Criteria criteria = this.getSession().createCriteria(
				PurchaseStoreIn.class);
		criteria.add(Restrictions.eq("purchaseOrder", purchaseOrder));
		return criteria.list();
	}

}
